package tw.com.softleader.reins.demo.smartphone.app;

import tw.com.softleader.reins.demo.smartphone.dao.SmartPhoneDAOImplement;
import tw.com.softleader.reins.demo.smartphone.entity.SmartPhone;

public class SmartPhoneApp {

	public static void main(String[] args) {
		SmartPhoneDAOImplement smartPhoneImp = new SmartPhoneDAOImplement();
		
		System.out.println("---getAll Method---");

		for (SmartPhone smartPhone : smartPhoneImp.selectAll()) {
			System.out.print(smartPhone.getId() + "\t");
			System.out.print(smartPhone.getName() + "\t");
			System.out.print(smartPhone.getSystem() + "\t");
			System.out.print(smartPhone.getResWidth() + "x"
					+ smartPhone.getResHeight() + "\t");
			System.out.println(smartPhone.getSystem());
		}
		
		/*
		SmartPhoneService smartPhoneService = new SmartPhoneService();

		System.out.println("---selectAll Method---");

		for (SmartPhone smartPhone : smartPhoneService.selectAll()) {
			System.out.print(smartPhone.getId() + "\t");
			System.out.print(smartPhone.getName() + "\t");
			System.out.print(smartPhone.getSystem() + "\t");
			System.out.print(smartPhone.getResWidth() + "x"
					+ smartPhone.getResHeight() + "\t");
			System.out.println(smartPhone.getSystem());
		}

		System.out.println("---selectById Method---");

		SmartPhone smartPhone = smartPhoneService.selectById(1L);
		System.out.print(smartPhone.getId() + "\t");
		System.out.print(smartPhone.getName() + "\t");
		System.out.print(smartPhone.getSystem() + "\t");
		System.out.print(smartPhone.getResWidth() + "x"
				+ smartPhone.getResHeight() + "\t");
		System.out.println(smartPhone.getSystem());
		*/
	}
}
